import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import VueAxios from 'vue-axios'
import 'lib-flexible/flexible'

import { 
  Icon,
  Search,
  NoticeBar,
  Swipe,
  SwipeItem,
  Tab, 
  Tabs,
  Toast,
  Dialog,
  DropdownMenu,
  DropdownItem,
  Grid,
  GridItem,
  PullRefresh,
  List,
  Lazyload,
  Popup,
  ActionSheet,
  Loading,
  NavBar,
  Collapse, 
  CollapseItem,
  Cell,
  ShareSheet,
  Sticky,
  Rate,
  Divider,
  Overlay,
  Button,
  Field,
  Form,
  Sidebar,
  SidebarItem 
 } from 'vant';

 Vue.use(Divider);
 Vue.use(ShareSheet);
Vue.use(Icon);
Vue.use(Search);
Vue.use(NoticeBar);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Grid);
Vue.use(GridItem);
Vue.use(Toast);
Vue.use(Dialog);
Vue.use(PullRefresh);
Vue.use(List);
Vue.use(Lazyload);
Vue.use(Popup);
Vue.use(ActionSheet);
Vue.use(Loading)
Vue.use(NavBar)
Vue.use(Collapse)
Vue.use(CollapseItem)
Vue.use(Cell)
Vue.use(ShareSheet)
Vue.use(Sticky)
Vue.use(Rate)
Vue.use(Overlay)
Vue.use(Button)
Vue.use(Form);
Vue.use(Field);
Vue.use(Sidebar)
Vue.use(SidebarItem)

Vue.use(VueAxios, axios)

Vue.config.productionTip = false

Vue.filter('forNumber',function(num){
    num = Number(num);
    if (num === 0) {
      return num + "";
    } else if (num > 1 && num < 10000) {
      return num + "";
    } else if(num > 10000){
      return (num / 10000).toFixed(2) + "w";
    }else{
      return num
    }
})


import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
Vue.use(VueAwesomeSwiper)

//请求地址默认值
axios.defaults.baseURL = 'https://apis.netstart.cn/bcomic/';

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
